package com.xbongbong.saas.model;

import com.xbongbong.paas.domain.entity.PaasFormSubDataEntity;
import com.xbongbong.paas.enums.DelEnum;
import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.IModel;
import com.xbongbong.pro.domain.entity.UpdateDataEntity;
import com.xbongbong.saas.domain.entity.ContractSubDataEntity;
import org.elasticsearch.action.support.WriteRequest;

import java.util.List;
import java.util.Map;

/**
 *
 * @author 魏荣杰
 * @date 2020/9/21 13:43
 * @since
 * @version
 */
public interface ContractSubDataModel extends IModel<ContractSubDataEntity> {
    @Override
    Integer insert(ContractSubDataEntity entity) throws XbbException;

    @Override
    Integer update(ContractSubDataEntity entity) throws XbbException;

    @Override
    List<ContractSubDataEntity> findEntitys(Map<String, Object> param);

    @Override
    Integer getEntitysCount(Map<String, Object> param);

    Integer insertBatch(List<ContractSubDataEntity> contractSubDataEntities) throws XbbException;

    List<ContractSubDataEntity> getByDataId(Long id, String corpid);

    Integer deleteBatch(String corpid, List<ContractSubDataEntity> contractSubDataEntities, WriteRequest.RefreshPolicy refreshPolicy) throws XbbException;

    Integer updateBatch(List<UpdateDataEntity> updateList, String corpid) throws XbbException;

    /**
     * 更新del
     * @param updateList
     * @param corpid
     * @param refreshPolicy
     * @param delEnum
     * @return
     * @throws XbbException
     */
    Integer updateDel(List<ContractSubDataEntity> updateList, String corpid, WriteRequest.RefreshPolicy refreshPolicy, DelEnum delEnum) throws XbbException;

    Integer deleteByDataId(Long dataId, String corpid) throws XbbException;

    Integer deleteBatchByDataId(List<Long> dataIds, String corpid, DelEnum delEnum) throws XbbException;

    List<ContractSubDataEntity> getByDataIds(List<Long> dataIds, String corpid, DelEnum delEnum);

    Integer updateBatchByEntity(List<? extends PaasFormSubDataEntity> list, String corpid) throws XbbException;
}
